// @Author EthanScriptOn
// @Desc
package config

import (
	"gitee.com/fatzeng/srf_switch_basic_components/util"
	"gitee.com/fatzeng/srf_switch_dynamic_logic_director/pojo"
	"github.com/go-xorm/xorm"
)

type PublishFunction func(log *pojo.SrfSwitchPublishLog) error

var SrfSwitchEventPublisherFunction *util.OnceInitializer

func GetSrfSwitchPublishFunction() PublishFunction {
	instance, _ := SrfSwitchEventPublisherFunction.Get()
	return instance.(PublishFunction)
}

var MysqlEngine *util.OnceInitializer

func GetMysqlEngine() *xorm.Engine {
	instance, _ := MysqlEngine.Get()
	return instance.(*xorm.Engine)
}
